<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head th:replace="common/form :: head"></head>
	
	<body class="mainbody">
		<form method="POST" th:object="${obj}" enctype="multipart/form-data">
			<div th:replace="common/form :: location('企业用户管理',*{id} gt 0 ?'修改企业用户信息':'新增企业用户')"></div>
			<div id="floatHead" class="content-tab-wrap">
			  <div class="content-tab">
			    <div class="content-tab-ul-wrap">
			      <ul>
			        <li><a href="javascript:;">企业用户信息</a></li>
			      </ul>
			    </div>
			  </div>
			</div>
			<div class="tab-content">
				<dl th:if="*{id} == 0">
					<dt>姓名</dt>
				    <dd>
				      <input type="text" th:field="*{name}" class="input normal" data-type="*2-10" data-ajaxurl="checkName" />
				      <span class="Validform_checktip">*姓名至少2个字符</span>
				    </dd>
				</dl>
		
				<dl>
					<dt>登录名</dt>
				    <dd>
				      <input type="text" th:field="*{loginName}" data-type="*1-11" class="input normal" />
				      <span class="Validform_checktip">*请填写登录名</span>
				    </dd>
				</dl>
				<dl th:if="*{id} == 0">
					<dt>密码</dt>
				    <dd>
				      <input type="password" th:field="*{password}" class="input normal" data-type="*5-15" />
				      <span class="Validform_checktip">*请输入5~15位密码</span>
				    </dd>
				</dl>
				<dl th:if="*{id} == 0">
					<dt>确认密码</dt>
				    <dd>
				      <input type="password" class="input normal" data-type="*" data-recheck="password" />
				      <span class="Validform_checktip">*重新输入密码</span>
				    </dd>
				</dl>
				
				<dl>
					<dt>性别</dt>
					<dd>
				    <label style="width: 80px;"> 
        				<input th:field="*{sex}" type="radio" name="mode" value="男"/>&nbsp;&nbsp;男
    				</label>
    				
    				<label style="width: 80px;"> 
        				<input th:field="*{sex}" type="radio" name="mode" value="女"/>&nbsp;&nbsp;女
    				</label>
    				</dd>
				</dl>
				
				<dl>
					<dt>年龄</dt>
				    <dd>
				      <input type="text" th:field="*{age}" data-type="*1-10" class="input normal" />
				      <span class="Validform_checktip">*请填写年龄</span>
				    </dd>
				</dl>
				
				<dl>
					<dt>手机号码</dt>
				    <dd>
				      <input type="text" th:field="*{phone}" data-type="m" class="input normal" />
				      <span class="Validform_checktip">*请填写您的手机号码</span>
				    </dd>
				</dl>
				
				<dl>
					<dt>邮箱</dt>
				    <dd>
				      <input type="text" th:field="*{email}" data-type="e" class="input normal" />
				      <span class="Validform_checktip">*请填写邮箱地址</span>
				    </dd>
				</dl>
				
			
				
				<dl>
					<dt>职位</dt>
					<dd>
				    <label style="width: 80px;"> 
        				<input th:field="*{job}" type="radio" name="mode" value="企业老板"/>&nbsp;&nbsp;企业老板
    				</label>
    				
    				<label style="width: 80px;"> 
        				<input th:field="*{job}" type="radio" name="mode" value="部门经理"/>&nbsp;&nbsp;部门经理
    				</label>
    				
    				<label style="width: 80px;"> 
        				<input th:field="*{job}" type="radio" name="mode" value="普通员工"/>&nbsp;&nbsp;普通员工
    				</label>
    				</dd>
				</dl>
				
				
				<dl>
					<dt>地址</dt>
				    <dd>
				      <input type="text" th:field="*{address}" data-type="*2-100" class="input normal" />
				      <span class="Validform_checktip">*请填写地址</span>
				    </dd>
				</dl>
				
				<dl>
				 	<dt>用户头像</dt> 
					<dd>
						<input type="file" name="PICN" onchange="previewFile()"/><br/>
						<img th:src="${pro}+*{imgUrl}" height="250px" width="10px" alt="Image preview..." class="input normal"/>
						<span class="Validform_checktip">*请选择用户头像</span>
					</dd>
			   </dl>
				
				
				
			 
				 
				 
				 
			</div>
			<div th:replace="common/form :: footer"></div>
		</form>

		<script type="text/javascript" th:replace="common/form :: formscript">
		</script>
		<script type="text/javascript">
		//图片预览
		function previewFile() {
			 var preview = document.querySelector('img');
			 var file  = document.querySelector('input[type=file]').files[0];
			 var reader = new FileReader();
			 reader.onloadend = function () {
			  preview.src = reader.result;
			 }
			 if (file) {
			  reader.readAsDataURL(file);
			 } else {
			  preview.src = "";
			 }
		}
			
		</script>
	</body>
</html>